<{include file="admincp_header.htm"}>
<script language="javascript" type="text/javascript">
function confirmdelete() {
	if(!confirm('<{$lan.suredelitem}>')) {
		return false;
	} else {
		document.location = "admincp.php?action=deleteitem&id=<{$id}>&returnlist=1";
	}
}
function checksubmit() {
	t = $('title');
	c = $('category');
	s = $('s');
	if(t.value == "") {
		alert("<{$lan.notitle}>");
		t.focus();
		return false;
	}
	if(c.value == "") {
		alert("<{$lan.nocategory}>");
		c.focus();
		return false;
	}
	s.disabled = true;
}
function selectcategory(l, c) {
	var coption = new Option("<{$lan.pleasechoose}>", 0);
	selectlength = $("category" + l).length;
	$("category" + l).options[0] = coption;
	for(i = 1; i < selectlength; i ++) {
		$("category" + l).options[1] = null;
	}
	if(c == 0) {
		if(l > 1) $("category").value = $("category" + (l - 2)).value;
	} else {
		$("category").value = c;
	}
	for(i = l; i < 10 ;i ++) {
		$("category" + i).style.display = "none";
	}
	if(c > 0 || l == 0) {
		var fileref = document.createElement("script");
		fileref.setAttribute("type", "text/javascript");
		fileref.setAttribute("src", "admincp.php?action=selectcategories&up="+c+"&level="+l+"&module=<{$moduleid}>&defaultlist=<{$categorylist}>");
		document.getElementsByTagName("head")[0].appendChild(fileref);
	}
}

function SetframeHeight(obj) {
	var iframeid = $(obj);
	if(iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight) {
		iframeid.height = iframeid.contentDocument.body.offsetHeight;
	} else {
		iframeid.height = iframeid.Document.body.scrollHeight;
	}
}
</script>
<body>
<div class="block"></div>
<form enctype="multipart/form-data" action="admincp.php?action=saveitem" method="post" onsubmit="return checksubmit()">
<input type="hidden" name="id" value="<{$id}>" />
<input type="hidden" name="MAX_FILE_SIZE" value="<{$maxattachsize}>" />
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="commontable" align="center">
<tr class="header">
	<td colspan="2"><{$operate}><{$lan.space}><{$lan.data}></td>
</tr>
<{$htmlfields}>
</table>
<div class="block"></div>
<div id="extfieldstable"></div>
<div class="block2"></div>
<center><input type="submit" value="<{$lan.save}>" id="s"></center>
</form>
</body>
</html>